home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F19450_LinksPull1.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  2.3 KB  |  63 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       HTML
  4.   Sub-category:   Hyperlinks
  5.   Author:         David Silverlight
  6.                   HeadGeek@xmlpitstop.com
  7.   Created:        2001-05-16
  8.   Description:-
  9.     This stylsheet demonstrates how to create hyperlinks from an
  10.     xml document. Also note that we are using the Pull method to
  11.     extract data from our xml document. The pull method is an
  12.     approach where the use of templates is minimized and data is
  13.     accessed by 'pulling' it from our xml document
  14. ================================================================ -->
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  16.   <xsl:output method="html" />
  17.  
  18.   <xsl:template match="/">
  19.     <html>
  20.       <head>
  21.         <style type="text/css">
  22.         H1 {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  23.         H2 {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  24.         .head {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  25.         .subhead {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  26.         .text {COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  27.         TH {COLOR: white; FONT-FAMILY: Arial; background-color: darkblue;}
  28.         TD {COLOR: darkblue; FONT-FAMILY: Arial}
  29.         TR { background-color: beige; }
  30.         BODY { background-color: beige; }
  31.         </style>
  32.       </head>
  33.       <body>
  34.         <h1>Loading an HTML combo box from xml (Using the Pull method)</h1>
  35.         <table border="1">
  36.           <tr>
  37.             <th>name</th>
  38.             <th>description</th>
  39.             <th>url</th>
  40.           </tr>
  41.           <xsl:for-each select="links/link">
  42.             <tr>
  43.               <td>
  44.                 <xsl:value-of select="@name" />
  45.               </td>
  46.               <td>
  47.                 <xsl:value-of select="@description" />
  48.               </td>
  49.               <td>
  50.                 <a>
  51.                   <xsl:attribute name="href">
  52.                     <xsl:value-of select="@url" />
  53.                   </xsl:attribute>
  54.                   <xsl:value-of select="@url" />
  55.                 </a>
  56.               </td>
  57.             </tr>
  58.           </xsl:for-each>
  59.         </table>
  60.       </body>
  61.     </html>
  62.   </xsl:template>
  63. </xsl:stylesheet>